<template>
    <div class="hire">
        <el-table
            :data="tabData"
            row-key="id"
            size="small"
            border
            v-loading="loading.value"
            ref="tab"
            @selection-change="saveSelection"
        >
            <el-table-column prop="name" label="录用人员"/>
            <el-table-column prop="sex" label="性别" width="120"/>
            <el-table-column prop="contact_phone" label="联系方式"/>
            <el-table-column prop="email" label="邮箱"/>
            <el-table-column prop="position_name" label="入职岗位"/>
            <el-table-column prop="is_send_office" label="是否已发送Office"/>
            <el-table-column label="操作" width="200">
                <template #default="s">
                    <el-button size="small" type="primary" :disabled="s.row.is_send_office === 1">发送office</el-button>
                    <el-button size="small" type="primary" @click="transactEntry(s.row.id)">办理入职</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import {getHireNotYetEntryHuman} from "../../../network/per/resume_classify";

export default {
    name: "EmpHire",
    data(){
        return{
            tabData:[
                {
                    "major": "所学专业",
                    "contact_phone": "16235235135",
                    "graduation_institutions": "毕业院校",
                    "sex": "男",
                    "name": "测试2",
                    "position_name": "财务部",
                    "academic_degree": 1,
                    "highest_education": 1,
                    "email": "3507641746@qq.com"
                }
            ],
            loading: {
                value: false
            },
            selection:[]
        }
    },
    methods: {
        transactEntry(id){
            this.$router.push('/per/entry/' + id)
        },
        saveSelection(selection){
            this.selection = selection;
        },
        //加载录用人员
        loadHireHuman(){
            getHireNotYetEntryHuman().then(data=>{
                this.tabData = data.data;
            })
        },
        init(){
            this.loadHireHuman();
        }
    },
    created() {
        this.init();
    }
}
</script>

<style scoped>
*{
    border: 1px solid red;
}
.hire {

}
</style>